package com.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.project.bean.ProductBean;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;

@Mapper
public interface IProductMapper extends BaseMapper<ProductBean> {


    public IPage<ProductBean> findByItem(
            Page<ProductBean> page,
            @Param("name") String name,
            @Param("startDate") LocalDate startDate,
            @Param("endDate") LocalDate endDate);

    /**
     * 按id查询商品，同时统计商品的售出数量
     * @param id
     * @return
     */
    public ProductBean findById(Integer id);


}
